package main

import "fmt"

type Student struct {
    name string
	id int
}

func main() {
	arrayA := [2]int{100, 200}
	var arrayB [2]int

	arrayB = arrayA

	fmt.Printf("arrayA : %p , %v\n", &arrayA, arrayA)
	fmt.Printf("arrayB : %p , %v\n", &arrayB, arrayB)

	testArray(arrayA)

	// slice := []map[string]interface{}{}
	slice := []Student{}
	a := Student{"a",1}
	b := Student{"b",2}
	slice = append(slice, a)
	fmt.Println(slice)
	slice = append(slice, b)
	fmt.Println(slice)

	array := []int{10, 20, 30, 40}
    slice1 := make([]int, 6)
    n := copy(slice1, array)
    fmt.Println(n,slice1)


	slice2 := []int{10, 20, 30, 40}
    for index, value := range slice2 {
        fmt.Printf("value = %d , value-addr = %x , slice-addr = %x\n", value, &value, &slice2[index])
    }
}

func testArray(x [2]int) {
	fmt.Printf("func Array : %p , %v\n", &x, x)
}